﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace BlogDemo.Core.Entities
{
    public class PagedList<T>
        where T : class, new()
    {
        public int PageIndex { get; set; }
        public int PageSize { get; set; }
        public int Total { get; set; }
        public int PageCount
        {
            get
            {
                return (Total+PageSize - 1) / PageSize;
            }
        }
        public IEnumerable<T> Items { get; set; }
        public PagedList(int pageIndex,int pageSize,int total,IEnumerable<T> items)
        {
            PageIndex = pageIndex;
            PageSize = pageSize;
            Total = total;
            Items = items;
        }
    }
}
